// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://b2b.casper.com.tr/CasperServices/WebService.asmx?WSDL
// Encoding : utf-8
// Version  : 1.0
// (25.10.2014 18:04:03 - 1.33.2.5)
// ************************************************************************ //

unit WebService;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"
  // !:boolean         - "http://www.w3.org/2001/XMLSchema"
  // !:int             - "http://www.w3.org/2001/XMLSchema"

  UrunBilgisiResult = class; { "http://tempuri.org/" }
  UrunRecetesiResult = class; { "http://tempuri.org/" }
  ProductSerialInfoResult = class; { "http://tempuri.org/" }



  // ************************************************************************ //
  // Namespace : http://tempuri.org/
  // ************************************************************************ //
  UrunBilgisiResult = class(TRemotable)
  private
  published
  end;



  // ************************************************************************ //
  // Namespace : http://tempuri.org/
  // ************************************************************************ //
  UrunRecetesiResult = class(TRemotable)
  private
  published
  end;



  // ************************************************************************ //
  // Namespace : http://tempuri.org/
  // ************************************************************************ //
  ProductSerialInfoResult = class(TRemotable)
  private
    Fschema: WideString;
  published
    property schema: WideString read Fschema write Fschema;
  end;


  // ************************************************************************ //
  // Namespace : http://tempuri.org/
  // soapAction: http://tempuri.org/%operationName%
  // transport : http://schemas.xmlsoap.org/soap/http
  // binding   : WebServiceSoap
  // service   : WebService
  // port      : WebServiceSoap
  // URL       : http://b2b.casper.com.tr/CasperServices/WebService.asmx
  // ************************************************************************ //
  WebServiceSoap = interface(IInvokable)
    ['{F790808E-B4BF-D72D-D6C0-3B8652961A63}']
    function HelloWorld: WideString; stdcall;
    function GetSerialNumByImei(const IMEINumber: WideString): WideString; stdcall;
    function GetSerialNumByImei2(const IMEINumber1: WideString; const IMEINumber2: WideString): WideString; stdcall;
    function UrunBilgisi(const SeriNo: WideString): UrunBilgisiResult; stdcall;
    function UrunRecetesi(const SeriNo: WideString): UrunRecetesiResult; stdcall;
    function ProductSerialInfo(const SerialNo: WideString): ProductSerialInfoResult; stdcall;
    function MerkezKayit(const SeriNo: WideString; const FirmaKodu: WideString; const Aciklama: WideString; const MusteriAdi: WideString; const Email: WideString; const Telefon: WideString; const AcikAdres: WideString; const il: WideString; const ilce: WideString): WideString; stdcall;
    function OnarimAsamasi(const ServiceOrderID: WideString; const AxDurumAdi: WideString; const YapilanIslem: WideString; const TeknisyenNotu: WideString): Boolean; stdcall;
    function ParcaArizaHareketleri(const ServiceOrderID: WideString; const UrunKodu: WideString; const BildirilenAriza: WideString; const TespitEdilenAriza: WideString; const UrunDurumu: Integer; const HataDurumu: Integer): Boolean; stdcall;
  end;

function GetWebServiceSoap(UseWSDL: Boolean = System.False; Addr: string = ''; HTTPRIO: THTTPRIO = nil): WebServiceSoap;


implementation

function GetWebServiceSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): WebServiceSoap;
const
  defWSDL = 'http://b2b.casper.com.tr/CasperServices/WebService.asmx?WSDL';
  defURL = 'http://b2b.casper.com.tr/CasperServices/WebService.asmx';
  defSvc = 'WebService';
  defPrt = 'WebServiceSoap';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as WebServiceSoap);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;


initialization
  InvRegistry.RegisterInterface(TypeInfo(WebServiceSoap), 'http://tempuri.org/', 'utf-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(WebServiceSoap), 'http://tempuri.org/%operationName%');
  InvRegistry.RegisterInvokeOptions(TypeInfo(WebServiceSoap), ioDocument);
  RemClassRegistry.RegisterXSClass(UrunBilgisiResult, 'http://tempuri.org/', 'UrunBilgisiResult');
  RemClassRegistry.RegisterXSClass(UrunRecetesiResult, 'http://tempuri.org/', 'UrunRecetesiResult');
  RemClassRegistry.RegisterXSClass(ProductSerialInfoResult, 'http://tempuri.org/', 'ProductSerialInfoResult');

end.
. 
